package com.example.util;

import lombok.Data;

/**
 * @Author 宋伟宁
 * @Date 2023/10/19
 * @Version 1.0
 **/
@Data
public class R<T> {
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 执行结果
     */
    private Boolean flag;

    /**
     * 执行的消息
     */
    private String message;
    /**
     * 传递的数据
     */
    private T data;

    public R() {
    }

    public R(Integer code, Boolean flag, String message, T data) {
        this.code = code;
        this.flag = flag;
        this.message = message;
        this.data = data;
    }

    public R(Integer code, Boolean flag, String message) {
        this.code = code;
        this.flag = flag;
        this.message = message;
    }
}
